package com.iweb.day12;

/**
 * @author WuYongheng
 * @date 2021/12/5
 * @description 多线程
 */
public class ThreadTest {
    public static void main(String[] args) {
        Thread thread = Thread.currentThread();
        System.out.println(thread.getName());
        // 子线程
        MyThread t1 = new MyThread();
        t1.setName("线程1");
        t1.start();
        MyThread t2 = new MyThread();
        t2.setName("线程2");
        t2.start();
        // 此处表示在mian方法中执行run()方法，不是多线程
//        t.run();
    }
}
